<template>
	<view class="box" @click="clikeOrange" :style="{backgroundColor:color}">
		{{num}}
	</view>
	<view>
		<switch checked @change="switchChanged" />
		<switch @change="switchChanged" />
		<button :loading="isLoading" type="primary">按钮</button>
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue";
	const num = ref(1)
	const color = ref("#010010");
	const isLoading = ref(false)
	function clikeOrange() {
		color.value = "#" + String(Math.random()).substring(3, 9)
		num.value++;
		console.log(123);
	};
	function switchChanged(e){
		console.log(e);
		isLoading.value = e.detail.value
		console.log(isLoading.value);
	};
</script>

<style lang="scss">
	.box {
		width: 200px;
		height: 200px;
		background-color: orange;
	}
</style>